unit uFrmWebBrowser;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, SHDocVw, uCxtForm;

type
  TFrmWebBrowser = class(TBaseForm)
    WebBrowser: TWebBrowser;
  end;

procedure ShowWebBrowser(const Title, Url: string;
  Width, Height: Integer; Max: Boolean = False);

implementation

{$r *.dfm}

var
  FrmWebBrowser: TFrmWebBrowser;

procedure ShowWebBrowser(const Title, Url: string;
  Width, Height: Integer; Max: Boolean);
begin
  if not Assigned(FrmWebBrowser) then
    Application.CreateForm(TFrmWebBrowser, FrmWebBrowser);
  FrmWebBrowser.Caption := Title;
  if Max then FrmWebBrowser.WindowState := wsMaximized
  else begin
    FrmWebBrowser.WindowState := wsNormal;
    FrmWebBrowser.Width := Width;
    FrmWebBrowser.Height := Height;
  end;
  FrmWebBrowser.WebBrowser.Navigate(Url);
  FrmWebBrowser.ShowModal;
end;

end.
